<?php

/**
 * *******************************************************************************
 * ImportedFiles Interface - Action 03
 * Getting Previous ImportFiled data in JSON Format
 * *******************************************************************************
 * Order manage by Internal ID
 * *******************************************************************************
 * @author $Author: damien.viguier@gmail.com $
 * @version $Rev: 21 $
 * @internal $Id: ajx-ui-ImportedFiles-a03.php 21 2013-08-18 11:26:53Z damien.viguier@gmail.com $
 * @internal $LastChangedDate: 2013-08-18 11:26:53 +0000 (Sun, 18 Aug 2013) $
 * @link $HeadURL: http://personal-ged.googlecode.com/svn/trunk/webroot/ajax/data/ajx-ui-ImportedFiles/ajx-ui-ImportedFiles-a03.php $
 * *******************************************************************************
 */

include_once './../class/ImportedFiles.class.php';
error_reporting(E_ERROR);

if(array_key_exists('ImportedFileID', $_REQUEST))
{
	$l_s_id = $_REQUEST['ImportedFileID'];
	$l_s_results = ImportedFiles::getPreviousImportedFile($l_s_id);
	
	if(count($l_s_results)==0)
	{
		$l_s_results["noresults"] = true;
		$l_s_results["increment"] = 0;
	}
	else
		$l_s_results["increment"] = -1;
}
else
{
	$l_s_results["err"] = "No valid ID of a Imported file was received.";
	$l_s_results["noresults"] = true;
	$l_s_results["increment"] = 0;
}
echo json_encode($l_s_results);
?>